﻿using Engine.DynamicObjectManager;
using SyneticStandards.Scenery.Grounds;
using SyneticStandards.Scenery.Materials;
using System.Windows.Forms;

namespace SyneticStandards.Configuration
{
    public class WorldRacing2ConfigurationData
    {
        #region Private Fields

        private SceneryObjectPropertiesFile sceneryObjectPropertiesFile;
        private TextureToMaterialFile textureToMaterialFile;

        #endregion Private Fields

        #region Public Constructors

        public WorldRacing2ConfigurationData()
        {
            this.sceneryObjectPropertiesFile = SceneryObjectPropertiesFile.FromFile(Application.StartupPath + "\\objectProperties.bin");

            GroundsFile groundsFile;
            this.textureToMaterialFile = TextureToMaterialFile.FromFile(Application.StartupPath + "\\textureSetup.bin", out groundsFile);

            this.GroundsFile = groundsFile;
        }

        #endregion Public Constructors

        #region Public Properties

        public GroundsFile GroundsFile { get; set; }

        public SceneryObjectPropertiesFile SceneryObjectPropertiesFile
        {
            get { return this.sceneryObjectPropertiesFile; }
            set { this.sceneryObjectPropertiesFile = value; }
        }

        public TextureToMaterialFile TextureToMaterialFile
        {
            get { return this.textureToMaterialFile; }
            set { this.textureToMaterialFile = value; }
        }

        public string Wr2DirectoryFolder
        {
            get
            {
                return SyneticStandardAddin.Default.WorldRacing2Folder;
            }
            set
            {
                SyneticStandardAddin.Default.WorldRacing2Folder = value;
            }
        }

        #endregion Public Properties

        #region Public Methods

        public void Save()
        {
            SyneticStandardAddin.Default.Save();
        }

        #endregion Public Methods
    }
}